/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package es.unavarra.iws.routerinstall.gui;

import es.unavarra.iws.routerinstall.engine.QueryManager;
import java.awt.Container;

/**
 *
 * @author aqm
 */
public class Menu extends javax.swing.JPanel {

    QueryManager qm = null;
    
    /**
     * Creates new form Menu
     */
    public Menu(QueryManager qm) {
        this.qm = qm;
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jlBusqueda = new javax.swing.JLabel();
        jlIcono = new javax.swing.JLabel();
        jlTItulo = new javax.swing.JLabel();
        jlTItulo1 = new javax.swing.JLabel();
        jbSalir = new javax.swing.JButton();
        jlBarra = new javax.swing.JLabel();
        jlAyuda = new javax.swing.JLabel();
        jlAcercade = new javax.swing.JLabel();
        jlInstalacion = new javax.swing.JLabel();
        jbAyuda = new javax.swing.JButton();
        jbBusqueda = new javax.swing.JButton();
        jbInstalacion = new javax.swing.JButton();
        jbAcercade = new javax.swing.JButton();
        jlBackground = new javax.swing.JLabel();

        setLayout(null);

        jlBusqueda.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        jlBusqueda.setForeground(new java.awt.Color(254, 254, 254));
        jlBusqueda.setText("Búsqueda");
        add(jlBusqueda);
        jlBusqueda.setBounds(300, 270, 130, 30);

        jlIcono.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/home32.png"))); // NOI18N
        add(jlIcono);
        jlIcono.setBounds(35, 30, 30, 30);

        jlTItulo.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        jlTItulo.setForeground(new java.awt.Color(255, 255, 255));
        jlTItulo.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jlTItulo.setText("Semantic Router Wizard");
        add(jlTItulo);
        jlTItulo.setBounds(100, 20, 310, 50);

        jlTItulo1.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        jlTItulo1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jlTItulo1.setText("Semantic Router Wizard");
        add(jlTItulo1);
        jlTItulo1.setBounds(102, 22, 310, 50);

        jbSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/exit32.png"))); // NOI18N
        jbSalir.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jbSalirMouseClicked(evt);
            }
        });
        add(jbSalir);
        jbSalir.setBounds(420, 20, 50, 50);

        jlBarra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/w70.png"))); // NOI18N
        add(jlBarra);
        jlBarra.setBounds(0, 20, 530, 50);

        jlAyuda.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        jlAyuda.setForeground(new java.awt.Color(254, 254, 254));
        jlAyuda.setText("Ayuda");
        add(jlAyuda);
        jlAyuda.setBounds(80, 520, 110, 30);

        jlAcercade.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        jlAcercade.setForeground(new java.awt.Color(254, 254, 254));
        jlAcercade.setText("Acerca de");
        add(jlAcercade);
        jlAcercade.setBounds(300, 520, 117, 30);

        jlInstalacion.setFont(new java.awt.Font("Verdana", 0, 24)); // NOI18N
        jlInstalacion.setForeground(new java.awt.Color(254, 254, 254));
        jlInstalacion.setText("Instalación");
        add(jlInstalacion);
        jlInstalacion.setBounds(70, 270, 140, 30);

        jbAyuda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/help.png"))); // NOI18N
        jbAyuda.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jbAyudaMouseClicked(evt);
            }
        });
        add(jbAyuda);
        jbAyuda.setBounds(70, 410, 110, 100);

        jbBusqueda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/question.png"))); // NOI18N
        jbBusqueda.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jbBusquedaMouseClicked(evt);
            }
        });
        add(jbBusqueda);
        jbBusqueda.setBounds(300, 160, 110, 100);

        jbInstalacion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/swr.png"))); // NOI18N
        jbInstalacion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jbInstalacionMouseClicked(evt);
            }
        });
        jbInstalacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbInstalacionActionPerformed(evt);
            }
        });
        add(jbInstalacion);
        jbInstalacion.setBounds(70, 160, 110, 100);

        jbAcercade.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/addressbook.png"))); // NOI18N
        jbAcercade.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jbAcercadeMouseClicked(evt);
            }
        });
        add(jbAcercade);
        jbAcercade.setBounds(300, 410, 110, 100);

        jlBackground.setIcon(new javax.swing.ImageIcon(getClass().getResource("/es/unavarra/iws/routerinstall/resources/img/swr2.png"))); // NOI18N
        add(jlBackground);
        jlBackground.setBounds(0, 0, 480, 640);
    }// </editor-fold>//GEN-END:initComponents
    private void jbInstalacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbInstalacionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbInstalacionActionPerformed

    private void jbInstalacionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbInstalacionMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Container menu = this.getFocusCycleRootAncestor();
        menu.remove(this);
        Instalar instala = new Instalar(qm);
        instala.setSize(menu.getSize());
        menu.add(instala, 0);
    }//GEN-LAST:event_jbInstalacionMouseClicked

    private void jbBusquedaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbBusquedaMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Container menu = this.getFocusCycleRootAncestor();
        menu.remove(this);
        Busqueda busqueda = new Busqueda(qm);
        busqueda.setSize(menu.getSize());
        menu.add(busqueda, 0);
    }//GEN-LAST:event_jbBusquedaMouseClicked

    private void jbAcercadeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbAcercadeMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Container menu = this.getFocusCycleRootAncestor();
        menu.remove(this);
        AcercaDe herramientas = new AcercaDe(qm);
        herramientas.setSize(menu.getSize());
        menu.add(herramientas, 0);
    }//GEN-LAST:event_jbAcercadeMouseClicked

    private void jbAyudaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbAyudaMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Container menu = this.getFocusCycleRootAncestor();
        menu.remove(this);
        Ayuda ayuda = new Ayuda(qm);
        ayuda.setSize(menu.getSize());
        menu.add(ayuda, 0);        
    }//GEN-LAST:event_jbAyudaMouseClicked

    private void jbSalirMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbSalirMouseClicked
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jbSalirMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbAcercade;
    private javax.swing.JButton jbAyuda;
    private javax.swing.JButton jbBusqueda;
    private javax.swing.JButton jbInstalacion;
    private javax.swing.JButton jbSalir;
    private javax.swing.JLabel jlAcercade;
    private javax.swing.JLabel jlAyuda;
    private javax.swing.JLabel jlBackground;
    private javax.swing.JLabel jlBarra;
    private javax.swing.JLabel jlBusqueda;
    private javax.swing.JLabel jlIcono;
    private javax.swing.JLabel jlInstalacion;
    private javax.swing.JLabel jlTItulo;
    private javax.swing.JLabel jlTItulo1;
    // End of variables declaration//GEN-END:variables
}
